﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 已发推广</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <script type='text/javascript'>
        window.BWEUM || (BWEUM = {});
        BWEUM.info = { "stand": true, "agentType": "browser", "agent": "bi-collector.oneapm.com/static/js/bw-send-411.4.5.js", "beaconUrl": "bi-collector.oneapm.com/beacon", "licenseKey": "7VNJE~EViAMmF7MA", "applicationID": 2278177 };</script>
    <script type="text/javascript" src="//bi-collector.oneapm.com/static/js/bw-loader-411.4.5.js"></script>
    <link rel="stylesheet" type="text/css" href="css/css.css?25" />
    <link rel="stylesheet" type="text/css" href="css/MakePublis.css" />
     <link href="css/MakeAdvertMain.css" rel="stylesheet" type="text/css" />

    <style>
        .shared{right: 65px;}
        .centenOff{ width:45px; margin-left:10px; background-color:#ccc; color:#fff}
        .check{right:0px;}
    </style>
</head>
<body>
    <div class="wamtop">
          <div class="topcententxt">
                推广</div>
            <div class="topright" style="color: white;" onClick="window.location.href='Makesh_1.html'">
                 分享</div>
    </div>
    <div id="waptxt">
     <div class="selectTags">
            <table class="tab">
                <tbody><tr>
                    <td>
                        <div class="model" id="Share" style="color: rgb(243, 123, 11); background-color: rgb(231, 231, 231);">
                            <img src="img/Makeimg/newicon/10.png">
                            <div>
                                已发推广
                            </div>
                            <div class="border" style="border-bottom-width: 2px; border-bottom-color: rgb(243, 123, 11); border-bottom-style: solid;"></div>
                        </div>
                    </td>
                    <td>
                        <div class="model" id="effect" onClick="window.location.href='makead_2.html'" style="background-color: rgb(244, 244, 244);">
                            <img src="img/Makeimg/newicon/11.png">
                            <div>
                                推广效果
                            </div>
                               <div class="border"></div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="model" id="pubsilh" style="background-color: rgb(244, 244, 244);" onClick="window.location.href='makead_3.html?25'">
                            <img src="img/Makeimg/newicon/13.png">
                            <div>
                                发布推广
                            </div>
                               <div class="border" style=""></div>
                        </div>
                    </td>
                    <td>
                        <div class="model" id="cost" style="background-color: rgb(244, 244, 244);" onClick="window.location.href='makead_4.html'">
                            <img src="img/Makeimg/newicon/15.png">
                            <div>
                                费用充值
                            </div>
                               <div class="border" style=""></div>
                        </div>
                    </td>
                </tr>
            </tbody></table>
        </div>
        <div class="Tags">
            <div class="Tagtxt">已发推广</div>
            <div class="numclass">
            <b class="sanjiao"></b>
            <div class="countnum"></div>
            </div>
        </div>
        <div id="ws_tg">
        </div>
            <div class="bottom">
            <ul>
                <li>
                    <div onClick="window.location.href='index.html??25'">
                        <img src="img/tab1_g.png" /><br />
                        发现
                    </div>
                </li>
                <li>
                    <div onClick="window.location.href='publish.html?25'">
                        <img src="img/tab2_g.png" /><br />
                        发布
                    </div>
                </li>
                <li>
                  <div class="Defutalcolor" style=" position:relative;">
                        <img src="img/tab3_y.png" />
                        <br />
                        推广                       
                    </div>
                </li>
                <li>
                    <div onClick="if(login())window.location.href = 'Personal.html?25'">
                        <img src="img/tab4_g.png" /><br />
                        我的
                    </div>
                </li>
            </ul>
        </div>

    </div>
</body>
<script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="js/dialog.js" type="text/javascript"></script>
<script src="js/ajax-data.js" type="text/javascript"></script>
<script src="js/base.js?25" type="text/javascript"></script>
<script>
    var pagecount = "0";
    var page = 1;
    var keyword = ""; //关键词

    $(document).ready(function () {
        load(page);
        $(window).bind("scroll", function () {
            //当滚动条滚动时
            var scollTop = $(this).scrollTop() + $(this).height();
            var scollH = $(document).height();
            if (scollH - scollTop < 100) {
                if (wait.isShow) { return; } //如果正在加载，则返回
                page++;
                load(page);
            }
            return false;
        });
        $("#searchico").bind("click", search);
    });
    var old = "";
    function load(page) {
        keyword = "";
        if (old != "" && old == keyword) return;
        if (!islogin()) { window.location.href = 'login.html'; return; }

        AjaxStart("ajax/fc_article.ashx?getlist", "&key_word=" + keyword + "&page_index=" + page, function (data) {
            old = keyword;
            if (data.code == "4") { pagecount = "1"; return; }
            if (data.item.pageCount < page) {
                if (pagecount == "0")
                    Alert('到底了！');
                pagecount = "1"; return;
            }
            $(".countnum").html(data.item.itemCount + " 条");
            loadhtml(data);
        });
    }
    function loadhtml(data) {
        $(data.item.table).each(function () {
            var logo = this.logo == null ? "img/30.png" : this.logo;
            var title = this.title;
            var titlelenth = 12;
            if (document.body.scrollWidth > 325) { titlelenth = 15; }
            if (title.length > titlelenth)
                title = title.substr(0, titlelenth) + "...";
            var css = "centenOff";
            var s2 = "未分享", s3 = "";
            if (this.state == 1) {
                s2 = "分享中";
                css = "centenOn";
                if (this.op_remainder < 1)
                    s2 = "分享完";
            }
            if (this.state == 0 && this.op_total >= 1 && this.op_price >= 1)
                s3 = "<div class=\"centenflow shared\" onclick=\"window.location.href='MakeFX.html?id=" + this.id + "'\">支付</div>";

            $("#ws_tg").append("<div id='r_" + this.id + "' class=\"centenlist\"><a href='fc_detail.aspx?article_id=" + this.id + "'><div class=\"centenimg\"><img src=\"" + logo + "\" /></div></a><div class=\"cententxt\">" +
            "<a href='fc_detail.aspx?article_id=" + this.id + "'><div class=\"cententitlte\">" + title + "</div></a>" +
            "<div class=\"centenTime\">" + this.date.substr(0, 10) +
            "<div id=\"" + this.id + "\" name='" + this.state + "'  class=\"check\"><img src=\"img/Delete2.jpg\" class=\"checkimg\"></div>" +
            "</div><div class=\"centenShare\">" +
            "<div class=\"" + css + "\">" + s2 + "</div></div>" + s3 + "<div class=\"centenflow\" onclick=\"window.location.href='makeset.html?id=" + this.id + "'\">设置</div></div></div>");
        });
        BindDel();
    }

    function search() {
        var url = $("#Stext").val();
        if (url.indexOf('http') == 0) {
            window.location.href = "makeurl_edit.html?url=" + encodeURIComponent(url);
        }
        else {
            $("#ws_tg").html("");
            load(page);
        }
    }

    //删除事件
    function BindDel() {
        $(".check").click(function () {

            if ($(this).attr("name") == '1') {
                Alert("分享中的文章不能删除")
                return false;
            }
            if (!confirm("确定要删除此推广文章吗"))
                return false;
            
            var id = this.id;
            AjaxStart("ajax/fc_article.ashx?delete", "id=" + this.id, function (data) {
                if (data.code == 0) {
                    $("#r_" + id).hide(500);
                    Alert("删除成功");
                }
            });
            return false;
        });
    }
</script>
</html>
